package cn.jdy.uum.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

@Entity // 标识 实体 会自动映射表
public class Emp {
  private static final long serialVersionUID = 1L;

  @Id // 设置为主键
  @GeneratedValue(generator="system-uuid")
  @GenericGenerator(name="system-uuid", strategy = "uuid.hex")
  @Column(length=32)
  private String id;
  private  Integer age;
  private Date birday;// 生日
  public Date getBirday() {
    return birday;
  }
  public void setBirday(Date birday) {
    this.birday = birday;
  }
  private Character sex;//0 1
  private String firstName;
  private String lastName;
  @ManyToOne(fetch = FetchType.LAZY) // 设置懒加载，只在使用这个数据的时候才发起查询
  @JoinColumn(name = "groupid")// emp表 groupid 外键关联group表的id
  private GroupEmp groupemp;
  public String getId() {
    return id;
  }
  public void setId(String id) {
    this.id = id;
  }
  public Integer getAge() {
    return age;
  }
  public void setAge(Integer age) {
    this.age = age;
  }
  public Character getSex() {
    return sex;
  }
  public void setSex(Character sex) {
    this.sex = sex;
  }
  public String getFirstName() {
    return firstName;
  }
  public void setFirstName(String firstName) {
    this.firstName = firstName;
  }
  public String getLastName() {
    return lastName;
  }
  public void setLastName(String lastName) {
    this.lastName = lastName;
  }
  public GroupEmp getGroupemp() {
    return groupemp;
  }
  public void setGroupemp(GroupEmp groupemp) {
    this.groupemp = groupemp;
  }
  
}
